#ifndef MOVE_H_
#define MOVE_H_

#include "Enums.h"
#include "../Board/Square.h"
#include "../Pieces/Piece.h"

#include <vector>
#include <string>
using namespace std;

namespace Core
{
	class Move
	{
	public:
		Move(Piece * piece, Square * to, ChAction action = ChActionNone, int moveNum = -1, Piece * pieceEaten = NULL);
		Move(const Move &move);
		~Move();

		//static Move createMove(Piece * piece, Square * dst);
		static void checkValidity(Move * mv);

		// GETTERS & SETTERS
		Piece * piece() const { return _piece; }
		void piece(Piece * val) { _piece = val; }
		Square * from() const { return _from; }
		void from(Square * val) { _from = val; }
		Square * to() const { return _to; }
		void to(Square * val) { _to = val; }
		int moveNum() const { return _moveNum; }
		void moveNum(int val) { _moveNum = val; }
		Move * nextMove() const { return _next; }
		void nextMove(Move * val) { _next = val; }
		Move * prevMove() const { return _prev; }
		void prevMove(Move * val) { _prev = val; }
		int action() const { return _action; }
		void action(int val) { _action = val; }
		//long long millisecs() const { return _millisecs; }
		//void millisecs(long long val) { _millisecs = val; }
		ChStatus status() const { return _status; }
		void status(ChStatus val) { _status = val; }
		Piece * pieceEaten() const { return _eaten; }
		void pieceEaten(Piece * val) { _eaten = val; }

		string toString() const;

	private:
//		Move();
		Piece * _piece;
		Square * _from;
		Square * _to;
		int _moveNum;
		Move * _next;
		Move * _prev;
		int _action;
		//long long _millisecs;
		ChStatus _status;
		Piece * _eaten;
	};

}
#endif
